<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>状态平滑的动画</title>
    <style>
        /*动画和过渡的选择：有用户交互的情况尽量使用过渡，默认情况下，如果当用户突然同时操作时，会生硬的回到初始状态*/

        @keyframes panoramic {
            to { background-position: 100% 0; }
        }
        .panoramic {
            width: 150px;
            height: 150px;
            background: url('http://c3.staticflickr.com/3/2671/3904743709_74bc76d5ac_b.jpg');
            background-size: auto 100%;

            animation: panoramic 10s linear infinite alternate;
            animation-play-state: paused;

        }

        .panoramic:hover, .panoramic:focus {
            animation-play-state: running;
        }
    </style>
</head>
<body>
    <div class="panoramic"></div>
</body>
</html>